package com.data.modules.health.controller;


import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.RandomUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.aliyuncs.exceptions.ClientException;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.data.common.api.vo.Result;
import com.data.common.aspect.annotation.AutoLog;
import com.data.common.constant.WebsocketConst;
import com.data.common.constant.enums.DySmsEnum;
import com.data.common.constant.enums.ProductEnum;
import com.data.common.system.vo.DictModel;
import com.data.common.util.*;
import com.data.modules.base.service.BaseCommonService;
import com.data.modules.health.entity.HlEventLog;
import com.data.modules.health.service.IHlEventLogService;
import com.data.modules.health.service.IHlUserService;
import com.data.modules.health.vo.BdeDeviceReqVo;
import com.data.modules.health.vo.DedResVo;
import com.data.modules.jhl.entity.SmJhlFall;
import com.data.modules.jhl.service.ISmJhlFallService;
import com.data.modules.message.websocket.WebSocket;
import com.data.modules.sm.entity.SmBuilding;
import com.data.modules.sm.entity.SmProject;
import com.data.modules.sm.entity.SysConfig;
import com.data.modules.sm.service.ISmProjectService;
import com.data.modules.sm.service.ISysConfigService;
import com.data.modules.smapp.entity.SmAppAd;
import com.data.modules.smapp.entity.SmAppNews;
import com.data.modules.smapp.service.ISmAppAdService;
import com.data.modules.smapp.service.ISmAppNewsService;
import com.data.modules.smapp.vo.AdReqVo;
import com.data.modules.smzh.entity.*;
import com.data.modules.smzh.service.*;
import com.data.modules.smzh.vo.*;
import com.data.modules.system.entity.User;
import com.data.modules.system.service.ISysDictService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;

/**
 * <p>
 * 用户表 前端控制器
 * </p>
 *
 * @Author boot
 */

@RestController
@RequestMapping("/hldevice")
@Api(tags="养老项目")
@Slf4j
@SuppressWarnings("ALL")
public class HlThirdController<stringWarnType> {


	@Autowired
	private IHlEventLogService hlEventLogService;

	@Autowired
	private IHlUserService hlUserService;


	@ApiOperation(value="事件上报日志", notes="事件上报日志")
	@PostMapping(value = "/v1/uploadEvent")
	public Result<?> add(@RequestBody HlEventLog hlEventLog) {
		hlEventLogService.save(hlEventLog);
		return Result.OK();
	}

	@ApiOperation(value="床头机获取显示信息接口", notes="床头机获取显示信息接口")
	@PostMapping(value = "/v1/bedDeviceSynInfo")
	public Result<?> bedDeviceSynInfo(@RequestBody BdeDeviceReqVo reqVo) {

		//hlEventLogService.save(hlEventLog);
		DedResVo vo =hlUserService.queryBedDeviceSynInfo(reqVo);
		return Result.OK(vo);
	}


}
